package com.kuanter.kuanterauto.utils;

/**
 * 控件动画类
 */
import android.content.Context;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

import com.kuanter.kuanterauto.R;



public class Animations {
	
	private Context context;
	
	public Animations(Context context){
		this.context=context;
	}
	
	/**
	 * 渐变动画效果 消失
	 */
	public  Animation alphaAnimations_gone(){
		Animation ani=AnimationUtils.loadAnimation(context, R.anim.alpha);
		return ani;
	}

	/**
	 * 渐变动画效果 显示
	 */
	public Animation alphaAnimations_show(){
		Animation ani=AnimationUtils.loadAnimation(context, R.anim.alpha_s);
		return ani;
	}
	
	/**
	 * 渐变动画效果
	 */
	public Animation A_Animation() {
//		AnimationSet aset = new AnimationSet(true);
//		Animation ai = new AlphaAnimation(1.0f, 0.0f);
//		ai.setDuration(3000);
//		aset.addAnimation(ai);
		Animation ai=AnimationUtils.loadAnimation(context, R.anim.alpha);
		return ai;
	}
	
	/**
	 * 缩放动画效果
	 */
	public Animation s_Animation(){
//		AnimationSet aset=new AnimationSet(true);
//		Animation a=new ScaleAnimation(1.0f, 1.5f, 1.0f, 1.5f, 
//				Animation.RELATIVE_TO_SELF, 0.5f,
//				Animation.RELATIVE_TO_SELF,0.5f);
//		a.setDuration(2000);
//		aset.addAnimation(a);
		Animation a=AnimationUtils.loadAnimation(context, R.anim.scale);
		return a;
	}
	
	/**
	 * 旋转
	 * @return 
	 */
	public Animation r_Animation(){
//		AnimationSet aset=new AnimationSet(true);
//		Animation a=new RotateAnimation(0.0f,360.0f,
//				Animation.RELATIVE_TO_SELF,0.5f,
//				Animation.RELATIVE_TO_SELF,0.5f);
//		a.setDuration(2000);
//		aset.addAnimation(a);
		Animation a=AnimationUtils.loadAnimation(context, R.anim.rotate);
		return a;
	}
	
	/**
	 * 移动
	 */
	public Animation t_Animation(){
//		AnimationSet aset=new AnimationSet(true);
//		Animation a=new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f,
//											Animation.RELATIVE_TO_PARENT, 0.5f,
//											Animation.RELATIVE_TO_PARENT, 0.0f,
//											Animation.RELATIVE_TO_PARENT, 0.5f);
//		aset.addAnimation(a);
//		a.setDuration(3000);
//		mImageView.startAnimation(aset);
		Animation a=AnimationUtils.loadAnimation(context, R.anim.translate);
		return a;
	}
	
//	/**
//	 * 帧动画
//	 */
//	public void farme(){
//		mImageView.setImageResource(R.drawable.ami);
//		AnimationDrawable drawable=(AnimationDrawable)mImageView.getDrawable();
//		drawable.start();
//	}
}

